Summary

How well does historical experience rating predict average plus/minus differential in summer hat league 2016?


In [1]:
# Load the "autoreload" extension
%load_ext autoreload

# always reload modules marked with "%aimport"
%autoreload 1

import os
import sys

# add the 'src' directory as one where we can import modules
src_dir = os.path.join(os.getcwd(), os.pardir, 'src', 'data')
sys.path.append(src_dir)

In [2]:
%aimport scrape_buda

In [101]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

In [97]:
import scrape_buda

In [42]:
ratings = scrape_buda.BudaRating()

In [43]:
data_dir = os.path.join(os.getcwd(), os.pardir, 'data', 'interim')

In [44]:
prefix = os.path.join(data_dir, 'data20160521')

In [45]:
ratings.scrape_buda(prefix)


Planning to scrape 110 leagues out of a total of 200 leagues in the BUDA database.
Spring Women's League and Clinics- 2017 is not Hat or Club, skipping 41360
Unable to find a database of scores for league 41287
U19 League - Fall- 2016 is not Hat or Club, skipping 41328
U16 League - Fall- 2016 is not Hat or Club, skipping 41324
Newton girls middle school team (Fall)- 2016 is not Hat or Club, skipping 41315
Fall Grandmasters Free Agents- 2016 is not Hat or Club, skipping 41303
Fall Grandmasters League- 2016 is not Hat or Club, skipping 41299
Fall Masters Hat League- 2016 is not Hat or Club, skipping 41297
Fall Worcester Hat League - 2016 is not Hat or Club, skipping 41292
Unable to find a database of scores for league 41282
Unable to find a database of scores for league 41278
Unable to find a database of scores for league 41272
Summer Worcester Hat League - 2016 is not Hat or Club, skipping 41064
Finished successfully with league 41051
U16 League - Summer- 2016 is not Hat or Club, skipping 40627
U19 Summer (Western MA)- 2016 is not Hat or Club, skipping 40623
U19 Summer (Eastern MA)- 2016 is not Hat or Club, skipping 40619
Spring Women's League and Clinics- 2016 is not Hat or Club, skipping 40491
Spring Masters- 2016 is not Hat or Club, skipping 40278
Spring Grandmasters League- 2016 is not Hat or Club, skipping 40273
Spring Grandmasters Free Agents- 2016 is not Hat or Club, skipping 40268
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Uh oh, duplicate found in league 40264!
Finished successfully with league 40264
Found that league 40258 has already been scraped, skipping
Spring Worcester Hat League - 2016 is not Hat or Club, skipping 40253
Newton girls middle school team (spring)- 2016 is not Hat or Club, skipping 40249
xxNewton U14 Team- 2016 is not Hat or Club, skipping 40245
Found that league 39633 has already been scraped, skipping
Unable to find a database of scores for league 39960
U19 Select Travel Team- 2015 is not Hat or Club, skipping 39939
Newton girls middle school team (Fall)- 2015 is not Hat or Club, skipping 39904
U19 League - Fall- 2015 is not Hat or Club, skipping 39678
Fall Women's League- 2015 is not Hat or Club, skipping 39673
Found that league 39641 has already been scraped, skipping
Found that league 39628 has already been scraped, skipping
Found that league 39622 has already been scraped, skipping
Fall Grandmasters League- 2015 is not Hat or Club, skipping 39616
Fall Grandmasters Free Agents- 2015 is not Hat or Club, skipping 39611
Fall Worcester Hat League - 2015 is not Hat or Club, skipping 39602
Found that league 39344 has already been scraped, skipping
Women's League- 2015 is not Hat or Club, skipping 38871
U19 Summer (Western MA)- 2015 is not Hat or Club, skipping 38552
U19 Summer (Eastern MA)- 2015 is not Hat or Club, skipping 38548
Spring Grandmasters Free Agents- 2015 is not Hat or Club, skipping 38516
Spring Grandmasters League- 2015 is not Hat or Club, skipping 38506
U16 League - Spring- 2015 is not Hat or Club, skipping 38502
U16 League - Fall- 2015 is not Hat or Club, skipping 38498
Summer Worcester Hat League - 2015 is not Hat or Club, skipping 38493
Spring Worcester Hat League - 2015 is not Hat or Club, skipping 38490
Found that league 38484 has already been scraped, skipping
Found that league 38480 has already been scraped, skipping
Newton girls middle school team- 2015 is not Hat or Club, skipping 38475
Found that league 37668 has already been scraped, skipping
U19 Select Travel Team- 2014 is not Hat or Club, skipping 37959
U16 League - Fall- 2014 is not Hat or Club, skipping 37690
U19 League - Fall- 2014 is not Hat or Club, skipping 37686
Fall Grandmasters League- 2014 is not Hat or Club, skipping 37674
Found that league 37663 has already been scraped, skipping
Found that league 37659 has already been scraped, skipping
Fall Worcester Hat League - 2014 is not Hat or Club, skipping 37653
Found that league 37648 has already been scraped, skipping
YCC- 2014 is not Hat or Club, skipping 37634
U19 Summer (Western MA)- 2014 is not Hat or Club, skipping 37376
U19 Summer (Eastern MA)- 2014 is not Hat or Club, skipping 37370
Found that league 36881 has already been scraped, skipping
Women's League- 2014 is not Hat or Club, skipping 36852
Learning League- 2014 is not Hat or Club, skipping 36841
Eternal Youth GM Tournament- 2014 is not Hat or Club, skipping 36824
Coaches Workshop- 2014 is not Hat or Club, skipping 36530
Newton girls middle school team- 2014 is not Hat or Club, skipping 36486
Spring Grandmasters Hat League- 2014 is not Hat or Club, skipping 36481
Youth League (Grades 5-8) - Newton- 2014 is not Hat or Club, skipping 36469
Found that league 36465 has already been scraped, skipping
Found that league 36459 has already been scraped, skipping
Found that league 35836 has already been scraped, skipping
Found that league 35831 has already been scraped, skipping
High School Select Travel Team- 2013 is not Hat or Club, skipping 35821
Youth League (Grades 5-8) - Newton- 2013 is not Hat or Club, skipping 35817
Fall Grandmasters Club League- 2013 is not Hat or Club, skipping 35487
Found that league 35481 has already been scraped, skipping
Fall Grand Masters Hat League- 2013 is not Hat or Club, skipping 35476
Found that league 35470 has already been scraped, skipping
Fall High School Club League- 2013 is not Hat or Club, skipping 35462
GM Summer Start Tournament- 2013 is not Hat or Club, skipping 35358
Found that league 34896 has already been scraped, skipping
Learning League- 2013 is not Hat or Club, skipping 34841
Women's League- 2013 is not Hat or Club, skipping 34579
Found that league 34550 has already been scraped, skipping
Spring Grandmasters Hat League- 2013 is not Hat or Club, skipping 34524
Found that league 34405 has already been scraped, skipping
Newton girls middle school team- 2013 is not Hat or Club, skipping 34400
Found that league 34395 has already been scraped, skipping
Found that league 34330 has already been scraped, skipping
Fall High School Club League- 2012 is not Hat or Club, skipping 34170
Fall Grandmasters Club League- 2012 is not Hat or Club, skipping 34023
Found that league 33993 has already been scraped, skipping
Found that league 33985 has already been scraped, skipping
Fall Grand Masters Hat League- 2012 is not Hat or Club, skipping 33980
Found that league 33233 has already been scraped, skipping
Found that league 32945 has already been scraped, skipping
Learning League- 2012 is not Hat or Club, skipping 32941
Spring Grandmasters Hat League- 2012 is not Hat or Club, skipping 32936
Found that league 32746 has already been scraped, skipping
Found that league 32741 has already been scraped, skipping
Grandmasters Day of Play- 2011 is not Hat or Club, skipping 32566
Grandmasters Day of Play - Individual Registration- 2011 is not Hat or Club, skipping 32563
Found that league 32420 has already been scraped, skipping
Fall Grand Masters Hat League- 2011 is not Hat or Club, skipping 32268
Found that league 32262 has already been scraped, skipping
Found that league 31034 has already been scraped, skipping
Found that league 31029 has already been scraped, skipping
Learning League- 2011 is not Hat or Club, skipping 31023
Spring Grandmasters Hat League- 2011 is not Hat or Club, skipping 31018
Youth League- 2011 is not Hat or Club, skipping 31014
Competitive Youth Clinic- 2011 is not Hat or Club, skipping 31007
Found that league 31002 has already been scraped, skipping
Found that league 30924 has already been scraped, skipping
Found that league 30919 has already been scraped, skipping
Found that league 30844 has already been scraped, skipping
Spring Grandmasters Hat League- 2010 is not Hat or Club, skipping 29449
Spring Grandmasters Club League- 2010 is not Hat or Club, skipping 29432
Fall Grand Masters League- 2010 is not Hat or Club, skipping 29390
Found that league 29389 has already been scraped, skipping
Found that league 29388 has already been scraped, skipping
Found that league 29387 has already been scraped, skipping
Learning League- 2010 is not Hat or Club, skipping 29386
Found that league 29385 has already been scraped, skipping
Massachusetts High School League- 2010 is not Hat or Club, skipping 29237
Found that league 29235 has already been scraped, skipping
Found that league 29192 has already been scraped, skipping
Found that league 29187 has already been scraped, skipping
Fall Grand Masters League- 2009 is not Hat or Club, skipping 28912
Massachusetts High School League- 2009 is not Hat or Club, skipping 26998
Found that league 26909 has already been scraped, skipping
Found that league 26908 has already been scraped, skipping
Found that league 26907 has already been scraped, skipping
Found that league 26906 has already been scraped, skipping
Found that league 26905 has already been scraped, skipping
Learning League- 2009 is not Hat or Club, skipping 26904
Found that league 26903 has already been scraped, skipping
Massachusetts High School League- 2008 is not Hat or Club, skipping 23714
No base rating for Grand Masters, skipping league 23696
Found that league 23695 has already been scraped, skipping
Found that league 23694 has already been scraped, skipping
Found that league 23693 has already been scraped, skipping
Learning League- 2008 is not Hat or Club, skipping 23692
Found that league 23691 has already been scraped, skipping
Found that league 23626 has already been scraped, skipping
Found that league 20439 has already been scraped, skipping
Found that league 20438 has already been scraped, skipping
Found that league 20436 has already been scraped, skipping
Found that league 20435 has already been scraped, skipping
Learning League- 2007 is not Hat or Club, skipping 20434
Found that league 20433 has already been scraped, skipping
Found that league 20175 has already been scraped, skipping
Found that league 18047 has already been scraped, skipping
Found that league 17692 has already been scraped, skipping
Found that league 17691 has already been scraped, skipping
Learning League- 2006 is not Hat or Club, skipping 17604
Found that league 17603 has already been scraped, skipping
Found that league 17602 has already been scraped, skipping
Found that league 17499 has already been scraped, skipping
Found that league 16881 has already been scraped, skipping
Found that league 16880 has already been scraped, skipping
Found that league 13647 has already been scraped, skipping
Learning Leagues- 2005 is not Hat or Club, skipping 13447
Found that league 13446 has already been scraped, skipping
Found that league 13445 has already been scraped, skipping
Found that league 13215 has already been scraped, skipping
No base rating for Open, skipping league 12807
No base rating for Mixed A, skipping league 12807
No base rating for Mixed B, skipping league 12807
Found that league 12769 has already been scraped, skipping
SCL- 2004 is not Hat or Club, skipping 11632
Learning Leagues- 2004 is not Hat or Club, skipping 11631
Found that league 11604 has already been scraped, skipping
Found that league 11402 has already been scraped, skipping
Found that league 11401 has already been scraped, skipping
Found that league 10918 has already been scraped, skipping
No base rating for Open, skipping league 10917
No base rating for Mixed A, skipping league 10917
No base rating for Mixed B, skipping league 10917
Learning Leagues- 2003 is not Hat or Club, skipping 10309
SCL- 2003 is not Hat or Club, skipping 10217
Found that league 6340 has already been scraped, skipping
Found that league 6326 has already been scraped, skipping
Found that league 6235 has already been scraped, skipping
No base rating for OPEN, skipping league 5629
No base rating for Mixed A, skipping league 5629
No base rating for Mixed B, skipping league 5629
Found that league 5130 has already been scraped, skipping
Found that league 5129 has already been scraped, skipping
SCL- 2002 is not Hat or Club, skipping 4919
Learning Leagues- 2002 is not Hat or Club, skipping 4886
Found that league 3804 has already been scraped, skipping
Found that league 3669 has already been scraped, skipping
No base rating for Mixed, skipping league 3162
Found that league 3144 has already been scraped, skipping
Learning Leagues- 2001 is not Hat or Club, skipping 2408
Found that league 2407 has already been scraped, skipping
Found that league 1080 has already been scraped, skipping
Unable to find a database of scores for league 1083
Unable to find a database of scores for league 1082
Unable to find a database of scores for league 1081
Unable to find a database of scores for league 1095
Unable to find a database of scores for league 1094
Unable to find a database of scores for league 1093

In [49]:
indx = (ratings.allteams['season'] == 'Summer') & \
    (ratings.allteams['type'] == 'Club') & \
    (ratings.allteams['year'] == '2016')

In [50]:
len(ratings.allteams[indx])


Out[50]:
78

In [54]:
ratings.observed_rating()

In [98]:
ratings.predicted_rating()

In [99]:
pd.set_option('display.max_rows', 500)
ratings.allteams[indx].sort('observed_ratings')


Out[99]:
divname divrating plusminus season teamid teamname type year observed_ratings predicted_rating
3033 5/2 Div 3 900.0 -7.000000 Summer 40549 Spawning Alewives Club 2016 480.000000 768.634360
3001 4/3 Div 3 1000.0 -8.100000 Summer 40614 123 Trap! Club 2016 514.000000 690.568738
3029 5/2 Div 3 900.0 -4.833333 Summer 40545 M.O.B. Club 2016 610.000000 826.551146
3031 5/2 Div 3 900.0 -3.312500 Summer 40449 SIR! Club 2016 701.250000 766.536094
3027 5/2 Div 3 900.0 -2.526316 Summer 40544 Jiggy Club 2016 748.421053 895.073277
3034 5/2 Div 3 900.0 -2.500000 Summer 40602 THEM! Club 2016 750.000000 786.398241
3028 5/2 Div 3 900.0 -2.333333 Summer 40616 Killer Bees Club 2016 760.000000 1082.391136
3007 4/3 Div 3 1000.0 -3.500000 Summer 40582 Top Shelf Club 2016 790.000000 1064.964319
3032 5/2 Div 3 900.0 -1.714286 Summer 40591 Spam Club 2016 797.142857 948.300328
3002 4/3 Div 3 1000.0 -2.916667 Summer 40532 Baboon Heart Club 2016 825.000000 1091.542140
3035 5/2 Div 3 900.0 -0.600000 Summer 40536 Tofu Wolf Club 2016 864.000000 813.025686
3023 5/2 Div 3 900.0 -0.368421 Summer 40290 Alpha No Beta Club 2016 877.894737 1121.446018
3008 4/3 Div 3 1000.0 -1.411765 Summer 40609 Underwater Monkey Cowboys Club 2016 915.294118 1049.298526
3025 5/2 Div 3 900.0 0.650000 Summer 40296 Flying Salsa Club 2016 939.000000 977.913949
2999 4/3 Div 2 1400.0 -7.647059 Summer 40597 TuneSquad Squared Club 2016 941.176471 1095.170422
3046 Open Div 2 1200.0 -4.272727 Summer 41063 Sky Zone Club 2016 943.636364 904.377990
3024 5/2 Div 3 900.0 1.090909 Summer 40548 Demons Club 2016 965.454545 1268.803859
3005 4/3 Div 3 1000.0 -0.333333 Summer 40286 Stack to the Future Club 2016 980.000000 1103.151264
3003 4/3 Div 3 1000.0 -0.250000 Summer 40535 Batman and the Robins Club 2016 985.000000 840.122579
3030 5/2 Div 3 900.0 1.850000 Summer 40615 Rabbit Disc Club 2016 1011.000000 1029.118874
3026 5/2 Div 3 900.0 2.200000 Summer 40592 Granite State Grass Stains Club 2016 1032.000000 983.727495
3004 4/3 Div 3 1000.0 0.578947 Summer 40527 Oddjob Club 2016 1034.736842 790.080586
3038 Open Div 1 1400.0 -6.000000 Summer 40587 Desert Horizon Club 2016 1040.000000 1020.245614
2985 4/3 Div 2 1400.0 -5.444444 Summer 40603 Hipster Kitties Club 2016 1073.333333 1008.681771
2998 4/3 Div 2 1400.0 -5.235294 Summer 40608 Tubbs Club 2016 1085.882353 1128.935721
3017 5/2 Div 2 1300.0 -3.000000 Summer 40601 Iron Squids Club 2016 1120.000000 905.151261
3022 5/2 Div 2 1300.0 -2.900000 Summer 40605 The Funky Bunch Club 2016 1126.000000 921.936795
2991 4/3 Div 2 1400.0 -4.333333 Summer 40584 Moose Lightning Club 2016 1140.000000 1140.369804
3039 Open Div 1 1400.0 -3.714286 Summer 40631 DISCtinguished Gentlemen Club 2016 1177.142857 892.176917
2989 4/3 Div 2 1400.0 -3.700000 Summer 40294 Lady and the BAMF Club 2016 1178.000000 999.616555
3045 Open Div 2 1200.0 0.200000 Summer 40589 I'm not gonna not play Flong Club 2016 1212.000000 1137.967552
2979 4/3 Div 2 1400.0 -2.866667 Summer 40607 A Lil Bit Sticky Club 2016 1228.000000 1122.395982
2992 4/3 Div 2 1400.0 -2.842105 Summer 40533 Nerd Alert Club 2016 1229.473684 1202.380561
3042 Open Div 1 1400.0 -2.375000 Summer 40538 Savage Strike Club 2016 1257.500000 1262.280803
3006 4/3 Div 3 1000.0 4.538462 Summer 40595 Too Drunk to Fail Club 2016 1272.307692 1014.432639
3021 5/2 Div 2 1300.0 -0.428571 Summer 40537 SHRedline Club 2016 1274.285714 1148.272538
3016 5/2 Div 2 1300.0 -0.100000 Summer 40611 Hucky McThrowandcatch Club 2016 1294.000000 1518.225629
3014 5/2 Div 2 1300.0 0.111111 Summer 40447 Get Flat Ultimate Club 2016 1306.666667 1310.866732
3041 Open Div 1 1400.0 -1.500000 Summer 40585 Hammered Club 2016 1310.000000 1309.325056
2982 4/3 Div 2 1400.0 -0.461538 Summer 40534 Dominion Club 2016 1372.307692 1290.668644
2994 4/3 Div 2 1400.0 -0.300000 Summer 40308 Rogues' Gallery Club 2016 1382.000000 1126.755012
3013 5/2 Div 2 1300.0 1.636364 Summer 40606 Bacon Club 2016 1398.181818 1284.399300
2980 4/3 Div 2 1400.0 0.000000 Summer 40617 Booooooosh! Club 2016 1400.000000 992.264860
3043 Open Div 1 1400.0 0.153846 Summer 40292 Squid Squad Club 2016 1409.230769 1041.170455
3015 5/2 Div 2 1300.0 2.000000 Summer 40618 Hippos Club 2016 1420.000000 1203.071051
2996 4/3 Div 2 1400.0 0.333333 Summer 40297 Store Bought Dirt Club 2016 1420.000000 1306.633538
2983 4/3 Div 2 1400.0 0.473684 Summer 40446 Fetch Club 2016 1428.421053 1217.913985
3040 Open Div 1 1400.0 1.100000 Summer 41060 Fat Bass Ultimate Club 2016 1466.000000 1128.619698
3009 5/2 Div 1 1700.0 -3.400000 Summer 40610 Shake and Bake Club 2016 1496.000000 962.165631
2988 4/3 Div 2 1400.0 1.600000 Summer 40542 JHOP Club 2016 1496.000000 1284.643354
2997 4/3 Div 2 1400.0 1.739130 Summer 40588 Toads Club 2016 1504.347826 1213.785246
2981 4/3 Div 2 1400.0 1.823529 Summer 40586 Disc Envy Club 2016 1509.411765 1180.502669
2970 4/3 Div 1 1800.0 -4.700000 Summer 40291 BBN Club 2016 1518.000000 1457.081440
3019 5/2 Div 2 1300.0 3.818182 Summer 40594 Maverick Club 2016 1529.090909 1495.722854
3012 5/2 Div 2 1300.0 3.916667 Summer 40604 Baba Yaga Club 2016 1535.000000 1203.763749
2995 4/3 Div 2 1400.0 2.307692 Summer 40541 Rubs The Duckie Club 2016 1538.461538 1321.713276
2990 4/3 Div 2 1400.0 2.421053 Summer 40599 License to Kilt (fka Scoobers in Scotland) Club 2016 1545.263158 1207.679615
3044 Open Div 1 1400.0 2.750000 Summer 40543 Stall 9 Club 2016 1565.000000 1253.749923
2984 4/3 Div 2 1400.0 3.300000 Summer 40530 Flaming Croissants Club 2016 1598.000000 1049.553116
3018 5/2 Div 2 1300.0 5.142857 Summer 40531 JuJu Hex Club 2016 1608.571429 1345.927144
3020 5/2 Div 2 1300.0 5.272727 Summer 40613 Pink Flamingos Club 2016 1616.363636 1130.778239
3037 Open Div 1 1400.0 3.650000 Summer 40285 Crossroads Club 2016 1619.000000 1419.954861
2987 4/3 Div 2 1400.0 3.833333 Summer 40293 Jack's Abby HAOS Lager Club 2016 1630.000000 1184.942102
2993 4/3 Div 2 1400.0 4.083333 Summer 40295 Puddingstone Club 2016 1645.000000 1326.786517
3000 4/3 Div 2 1400.0 4.576923 Summer 40547 Upstream Club 2016 1674.615385 1343.483693
2974 4/3 Div 1 1800.0 -2.052632 Summer 40583 Live Poultry, Fresh Killed (LPFK) Club 2016 1676.842105 1489.931771
2977 4/3 Div 1 1800.0 -0.800000 Summer 40289 Turtle Boy Club 2016 1752.000000 1325.323881
2976 4/3 Div 1 1800.0 -0.692308 Summer 40593 TuneSquad Club 2016 1758.461538 1131.635716
3036 Open Div 1 1400.0 6.000000 Summer 40596 215 Needham Street Club 2016 1760.000000 1465.128847
2975 4/3 Div 1 1800.0 -0.500000 Summer 40590 Swingers Club 2016 1770.000000 1663.108784
2986 4/3 Div 2 1400.0 6.666667 Summer 40598 Injustice League Club 2016 1800.000000 1302.043332
3011 5/2 Div 1 1700.0 2.000000 Summer 40450 Stonecutters Club 2016 1820.000000 1689.162798
2973 4/3 Div 1 1800.0 1.526316 Summer 40540 GrassBurner Club 2016 1891.578947 1538.654993
2978 4/3 Div 1 1800.0 1.571429 Summer 40539 Zerg Rush! Club 2016 1894.285714 1625.082950
2971 4/3 Div 1 1800.0 1.812500 Summer 40612 FlowChart Club 2016 1908.750000 1575.228568
2972 4/3 Div 1 1800.0 2.937500 Summer 40288 Gothrilla Club 2016 1976.250000 1599.570190
3010 5/2 Div 1 1700.0 6.600000 Summer 40600 SnakeCountryBromance Club 2016 2096.000000 1890.880707
2969 4/3 Div 1 1800.0 7.142857 Summer 40546 AHOC Club 2016 2228.571429 1553.307117

In [121]:
sns.set_context('poster')
indx = (ratings.allteams['season'] == 'Summer') & \
    (ratings.allteams['type'] == 'Club') & \
    (ratings.allteams['year'] == '2016')
plt.plot(ratings.allteams.ix[indx, 'predicted_rating'], ratings.allteams.ix[indx, 'observed_ratings'], '.', 
         label='Summer Club 2016')
plt.xlabel('Predicted Rating')
plt.ylabel('Observed Rating')
plt.plot([600, 2000], [600, 2000], label='1:1 Relationship')
plt.title('Summer Club League 2016')
plt.legend(loc='upper left')


Out[121]:
<matplotlib.legend.Legend at 0x120b12090>

That green line above is not a fit to the data -- it's a straight up 1:1 line. So just based on what teams someone has played on in the past, we can predict how well that person's new club team will do pretty well. In general, the observed ratings are a bit higher than the predicted ratings. This could be related to the way I handle players with no experience in the database. Would be interesting to see if amount of departure from the 1:1 line corresponds to number of players with no experience.


In [122]:
ratings.allteams[indx]


Out[122]:
divname divrating plusminus season teamid teamname type year observed_ratings predicted_rating
2969 4/3 Div 1 1800.0 7.142857 Summer 40546 AHOC Club 2016 2228.571429 1553.307117
2970 4/3 Div 1 1800.0 -4.700000 Summer 40291 BBN Club 2016 1518.000000 1457.081440
2971 4/3 Div 1 1800.0 1.812500 Summer 40612 FlowChart Club 2016 1908.750000 1575.228568
2972 4/3 Div 1 1800.0 2.937500 Summer 40288 Gothrilla Club 2016 1976.250000 1599.570190
2973 4/3 Div 1 1800.0 1.526316 Summer 40540 GrassBurner Club 2016 1891.578947 1538.654993
2974 4/3 Div 1 1800.0 -2.052632 Summer 40583 Live Poultry, Fresh Killed (LPFK) Club 2016 1676.842105 1489.931771
2975 4/3 Div 1 1800.0 -0.500000 Summer 40590 Swingers Club 2016 1770.000000 1663.108784
2976 4/3 Div 1 1800.0 -0.692308 Summer 40593 TuneSquad Club 2016 1758.461538 1131.635716
2977 4/3 Div 1 1800.0 -0.800000 Summer 40289 Turtle Boy Club 2016 1752.000000 1325.323881
2978 4/3 Div 1 1800.0 1.571429 Summer 40539 Zerg Rush! Club 2016 1894.285714 1625.082950
2979 4/3 Div 2 1400.0 -2.866667 Summer 40607 A Lil Bit Sticky Club 2016 1228.000000 1122.395982
2980 4/3 Div 2 1400.0 0.000000 Summer 40617 Booooooosh! Club 2016 1400.000000 992.264860
2981 4/3 Div 2 1400.0 1.823529 Summer 40586 Disc Envy Club 2016 1509.411765 1180.502669
2982 4/3 Div 2 1400.0 -0.461538 Summer 40534 Dominion Club 2016 1372.307692 1290.668644
2983 4/3 Div 2 1400.0 0.473684 Summer 40446 Fetch Club 2016 1428.421053 1217.913985
2984 4/3 Div 2 1400.0 3.300000 Summer 40530 Flaming Croissants Club 2016 1598.000000 1049.553116
2985 4/3 Div 2 1400.0 -5.444444 Summer 40603 Hipster Kitties Club 2016 1073.333333 1008.681771
2986 4/3 Div 2 1400.0 6.666667 Summer 40598 Injustice League Club 2016 1800.000000 1302.043332
2987 4/3 Div 2 1400.0 3.833333 Summer 40293 Jack's Abby HAOS Lager Club 2016 1630.000000 1184.942102
2988 4/3 Div 2 1400.0 1.600000 Summer 40542 JHOP Club 2016 1496.000000 1284.643354
2989 4/3 Div 2 1400.0 -3.700000 Summer 40294 Lady and the BAMF Club 2016 1178.000000 999.616555
2990 4/3 Div 2 1400.0 2.421053 Summer 40599 License to Kilt (fka Scoobers in Scotland) Club 2016 1545.263158 1207.679615
2991 4/3 Div 2 1400.0 -4.333333 Summer 40584 Moose Lightning Club 2016 1140.000000 1140.369804
2992 4/3 Div 2 1400.0 -2.842105 Summer 40533 Nerd Alert Club 2016 1229.473684 1202.380561
2993 4/3 Div 2 1400.0 4.083333 Summer 40295 Puddingstone Club 2016 1645.000000 1326.786517
2994 4/3 Div 2 1400.0 -0.300000 Summer 40308 Rogues' Gallery Club 2016 1382.000000 1126.755012
2995 4/3 Div 2 1400.0 2.307692 Summer 40541 Rubs The Duckie Club 2016 1538.461538 1321.713276
2996 4/3 Div 2 1400.0 0.333333 Summer 40297 Store Bought Dirt Club 2016 1420.000000 1306.633538
2997 4/3 Div 2 1400.0 1.739130 Summer 40588 Toads Club 2016 1504.347826 1213.785246
2998 4/3 Div 2 1400.0 -5.235294 Summer 40608 Tubbs Club 2016 1085.882353 1128.935721
2999 4/3 Div 2 1400.0 -7.647059 Summer 40597 TuneSquad Squared Club 2016 941.176471 1095.170422
3000 4/3 Div 2 1400.0 4.576923 Summer 40547 Upstream Club 2016 1674.615385 1343.483693
3001 4/3 Div 3 1000.0 -8.100000 Summer 40614 123 Trap! Club 2016 514.000000 690.568738
3002 4/3 Div 3 1000.0 -2.916667 Summer 40532 Baboon Heart Club 2016 825.000000 1091.542140
3003 4/3 Div 3 1000.0 -0.250000 Summer 40535 Batman and the Robins Club 2016 985.000000 840.122579
3004 4/3 Div 3 1000.0 0.578947 Summer 40527 Oddjob Club 2016 1034.736842 790.080586
3005 4/3 Div 3 1000.0 -0.333333 Summer 40286 Stack to the Future Club 2016 980.000000 1103.151264
3006 4/3 Div 3 1000.0 4.538462 Summer 40595 Too Drunk to Fail Club 2016 1272.307692 1014.432639
3007 4/3 Div 3 1000.0 -3.500000 Summer 40582 Top Shelf Club 2016 790.000000 1064.964319
3008 4/3 Div 3 1000.0 -1.411765 Summer 40609 Underwater Monkey Cowboys Club 2016 915.294118 1049.298526
3009 5/2 Div 1 1700.0 -3.400000 Summer 40610 Shake and Bake Club 2016 1496.000000 962.165631
3010 5/2 Div 1 1700.0 6.600000 Summer 40600 SnakeCountryBromance Club 2016 2096.000000 1890.880707
3011 5/2 Div 1 1700.0 2.000000 Summer 40450 Stonecutters Club 2016 1820.000000 1689.162798
3012 5/2 Div 2 1300.0 3.916667 Summer 40604 Baba Yaga Club 2016 1535.000000 1203.763749
3013 5/2 Div 2 1300.0 1.636364 Summer 40606 Bacon Club 2016 1398.181818 1284.399300
3014 5/2 Div 2 1300.0 0.111111 Summer 40447 Get Flat Ultimate Club 2016 1306.666667 1310.866732
3015 5/2 Div 2 1300.0 2.000000 Summer 40618 Hippos Club 2016 1420.000000 1203.071051
3016 5/2 Div 2 1300.0 -0.100000 Summer 40611 Hucky McThrowandcatch Club 2016 1294.000000 1518.225629
3017 5/2 Div 2 1300.0 -3.000000 Summer 40601 Iron Squids Club 2016 1120.000000 905.151261
3018 5/2 Div 2 1300.0 5.142857 Summer 40531 JuJu Hex Club 2016 1608.571429 1345.927144
3019 5/2 Div 2 1300.0 3.818182 Summer 40594 Maverick Club 2016 1529.090909 1495.722854
3020 5/2 Div 2 1300.0 5.272727 Summer 40613 Pink Flamingos Club 2016 1616.363636 1130.778239
3021 5/2 Div 2 1300.0 -0.428571 Summer 40537 SHRedline Club 2016 1274.285714 1148.272538
3022 5/2 Div 2 1300.0 -2.900000 Summer 40605 The Funky Bunch Club 2016 1126.000000 921.936795
3023 5/2 Div 3 900.0 -0.368421 Summer 40290 Alpha No Beta Club 2016 877.894737 1121.446018
3024 5/2 Div 3 900.0 1.090909 Summer 40548 Demons Club 2016 965.454545 1268.803859
3025 5/2 Div 3 900.0 0.650000 Summer 40296 Flying Salsa Club 2016 939.000000 977.913949
3026 5/2 Div 3 900.0 2.200000 Summer 40592 Granite State Grass Stains Club 2016 1032.000000 983.727495
3027 5/2 Div 3 900.0 -2.526316 Summer 40544 Jiggy Club 2016 748.421053 895.073277
3028 5/2 Div 3 900.0 -2.333333 Summer 40616 Killer Bees Club 2016 760.000000 1082.391136
3029 5/2 Div 3 900.0 -4.833333 Summer 40545 M.O.B. Club 2016 610.000000 826.551146
3030 5/2 Div 3 900.0 1.850000 Summer 40615 Rabbit Disc Club 2016 1011.000000 1029.118874
3031 5/2 Div 3 900.0 -3.312500 Summer 40449 SIR! Club 2016 701.250000 766.536094
3032 5/2 Div 3 900.0 -1.714286 Summer 40591 Spam Club 2016 797.142857 948.300328
3033 5/2 Div 3 900.0 -7.000000 Summer 40549 Spawning Alewives Club 2016 480.000000 768.634360
3034 5/2 Div 3 900.0 -2.500000 Summer 40602 THEM! Club 2016 750.000000 786.398241
3035 5/2 Div 3 900.0 -0.600000 Summer 40536 Tofu Wolf Club 2016 864.000000 813.025686
3036 Open Div 1 1400.0 6.000000 Summer 40596 215 Needham Street Club 2016 1760.000000 1465.128847
3037 Open Div 1 1400.0 3.650000 Summer 40285 Crossroads Club 2016 1619.000000 1419.954861
3038 Open Div 1 1400.0 -6.000000 Summer 40587 Desert Horizon Club 2016 1040.000000 1020.245614
3039 Open Div 1 1400.0 -3.714286 Summer 40631 DISCtinguished Gentlemen Club 2016 1177.142857 892.176917
3040 Open Div 1 1400.0 1.100000 Summer 41060 Fat Bass Ultimate Club 2016 1466.000000 1128.619698
3041 Open Div 1 1400.0 -1.500000 Summer 40585 Hammered Club 2016 1310.000000 1309.325056
3042 Open Div 1 1400.0 -2.375000 Summer 40538 Savage Strike Club 2016 1257.500000 1262.280803
3043 Open Div 1 1400.0 0.153846 Summer 40292 Squid Squad Club 2016 1409.230769 1041.170455
3044 Open Div 1 1400.0 2.750000 Summer 40543 Stall 9 Club 2016 1565.000000 1253.749923
3045 Open Div 2 1200.0 0.200000 Summer 40589 I'm not gonna not play Flong Club 2016 1212.000000 1137.967552
3046 Open Div 2 1200.0 -4.272727 Summer 41063 Sky Zone Club 2016 943.636364 904.377990

Now let's take a look at Summer Hat League data.


In [123]:
sns.set_context('poster')
indx = (ratings.allteams['season'] == 'Summer') & \
    (ratings.allteams['type'] == 'Hat') & \
    (ratings.allteams['year'] == '2016')
divnames = ratings.allteams.ix[indx, 'divname'].unique()
for divname in divnames:
    subindx = indx = (ratings.allteams['season'] == 'Summer') & \
        (ratings.allteams['type'] == 'Hat') & \
        (ratings.allteams['year'] == '2016') & \
        (ratings.allteams['divname'] == divname)

    plt.plot(ratings.allteams.ix[indx, 'predicted_rating'], ratings.allteams.ix[indx, 'observed_ratings'], 'o', 
             label=divname)
plt.xlabel('Predicted Rating')
plt.ylabel('Observed Rating')
# plt.plot([600, 2000], [600, 2000], label='1:1 Relationship')
plt.title('Summer Hat League 2016')
plt.legend(loc='best')


Out[123]:
<matplotlib.legend.Legend at 0x1202244d0>

Not much correlation here at all. We're definitely in the small sample size regime here, but if anything there is evidence for anti-correlation in this diagram. Probably indicates that historical experience is not very applicable to the population of players in the summer hat league universe. For example, there are lots and lots of players with no experience in the database, and this method doesn't handle those very well at this point. Another point is that the baseline of predicted ratings really only varies by 100 - 150 points or so in this league. In spring hat league, for comparison, the baseline of predicted ratings varies by 200 - 250 points.

This probably indicates that historical experience is going to be important in leagues where the range in talent is large; spring hat league, winter hat league, holiday hat league, maybe fall hat league.


In [ ]: